﻿using System;

/*
 * Write a program to calculate the sum (with accuracy of 0.001): 1 + 1/2 - 1/3 + 1/4 - 1/5 + ...
 */
class Fibonacci
{
    static void Main(string[] args)
    {
        double sum = 1;
        int membersToSum = 10000;

        for (int i = 2; i < membersToSum; i++)
        {
            if (i % 2 == 0)
            {
                sum += (1.0 / i);
            }
            else
            {
                sum -= (1.0 / i);
            }
        }

        //Console.WriteLine(sum);
        Console.WriteLine(Math.Round(sum,3));
        
    }
}


